Skip to content

ci(docker): publish image from the release-please workflow - #13

Merged
coko7 merged 1 commit into
mainfrom
ci/docker-publish-from-release-please
Nov 16, 2026
Merged

coko7 merged 1 commit into
mainfrom
ci/docker-publish-from-release-please

Conversation

@coko7

@coko7 coko7 commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Problem

docker-publish.yml has never run. It listened for release: published, but release-please creates releases with the default GITHUB_TOKEN, and GitHub doesn't start other workflows from events made with that token. Merging the pending release PR (#7) would have created watari-v1.1.0 without building an image or showing any error.

The tags were broken too: release-please puts the component name in its tags (watari-v1.1.0). That isn't valid semver, so docker/metadata-action's type=semver rules would have dropped the version tags and pushed only latest.

Change

  • Move the build-and-push job into release-please.yml as a docker-publish job that runs after the release-please job, and only when release_created == 'true'. Because it's in the same workflow, it needs no personal access token.
  • Check out the release tag (tag_name output) rather than the tip of main.
  • Take the image tags from the bare version output, so the image gets 1.1.0, 1.1 and latest.
  • Set permissions per job: release-please keeps contents/pull-requests: write, Docker gets contents: read and packages: write.
  • Delete docker-publish.yml.

Testing

  • The workflow YAML parses. It hasn't been linted with actionlint, and the publish path hasn't run.
  • The first real run will be when chore(main): release watari 1.1.0 #7 is merged after this PR. Then check that the docker-publish job runs and that ghcr.io/coko7/watari gets the 1.1.0, 1.1 and latest tags.
  • If GHCR creates the package as private, change its visibility for anonymous pulls.

Co-Authored-By: lazytrek 352825308+lazytrek@users.noreply.github.com

docker-publish.yml listened for `release: published`, but release-please
creates releases with the default GITHUB_TOKEN, and events from that token
don't trigger other workflows, so the image was never built.

Move the build into release-please.yml as a job gated on the
release-please job's `release_created` output, and check out the release
tag. Use the bare `version` output for the image tags: the `watari-v`
prefixed tag name isn't valid semver, so metadata-action would have
dropped the version tags and pushed only `latest`.

Co-Authored-By: lazytrek <352825308+lazytrek@users.noreply.github.com>
@coko7
coko7 merged commit 2f49acf into main Nov 16, 2026
3 checks passed
@coko7
coko7 deleted the ci/docker-publish-from-release-please branch November 16, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant